LassoScript Utility
Basics Browse Detail

[OS_Process->ReadLine]

Tag Link [OS_Process->ReadLine] Category OS Process
Type Member Source Available Yes
Support Preferred Version 8.5
Change New Data Source Any
Output Type Bytes Security None
Implementation Sets Lasso 8.5

Description

[OS_Process->ReadLine] reads available data from the standard output of the native process up until the first new line, return, or return/new line pair and returns a string value. A -Timeout parameter specifies the time in seconds which the tag should wait for output to become available. If no data is available before the read times out then an empty string is returned.

If [OS_Process->SetEncoding] has been called then the data from the native process is automatically translated from the specified character set to Lasso's native string format. If no encoding has been specified then Lasso expects the process to return data in UTF-8 format.

Syntax

Var: 'myProcess' = (OS_Process: '/bin/cat');
$myProcess->(SetEncoding: 'iso-8859-1');
$myProcess->(Write: 'This is a test\n');
$myProcess->CloseWrite;
encode_html: $myProcess->ReadLine;
$myProcess->Close;

Parameters

Optional Parameters
-Timeout The maximum time to wait in seconds for data to become available for reading.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.